using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using XinBang.BLL;
using XinBang.Entity;

namespace XinBang.Web
{
    public partial class Site : System.Web.UI.MasterPage
    {
        private GoodsCatalogBL gcb = new GoodsCatalogBL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                catalogRepeater.DataSource = gcb.GetAllFirstCatalogs();
                catalogRepeater.DataBind();
            }
        }

        protected void bindSecondCatalog(object sender, RepeaterItemEventArgs e)
        {
            Repeater rep = (Repeater)e.Item.FindControl("catalogList");
            GoodsCatalog gc = (GoodsCatalog)(e.Item.DataItem);
            rep.DataSource = gcb.GetSecondCatalogsByParentId(gc.Catid);
            rep.DataBind();
        }
    }
}
